Make keyboard entry and return semantics consistent - #232
Conversation
# Conflicts: # skills/leaf/assets/runtime/living-margin.js
leaf-agent
left a comment
There was a problem hiding this comment.
The return stack reads well and the c / g T split is a clear improvement — one entry, one frame, one Escape is a much easier rule to hold than the rung ladder. Three things I'd want settled before this lands, all about a frame's active() being wider than the layer it names, plus one now-false comment.
The register-completeness one is the important one: RETURN is spliced into the dispatcher's stack but is not in SCOPES, and createReference walks SCOPES.toReversed(). So ? never names navigation.return, and it still lists navigation.back — whose does reads off rung() — as the page's Escape while the dispatcher is running the frame's. That is the reference and the press spelling one key differently, which the register invariant in skills/leaf/CLAUDE.md and the "three lists" comment above SCOPES both exist to prevent.
One more, outside the diff. version.js's comment block above closeVersionMenu still reads:
so every door into this menu shows it from the button and the way back out is the platform's on all of them: the pointer because the press focuses the button first,
vbecause the row focuses it before running that same press, and the reference because it stands a layer back up from that layer's invoker.
CHOOSER.run is now () => versionBtn.click(), so the middle clause is false and the v door's way back is the return frame rather than the platform's. Worth rewriting alongside the CHOOSER comment this PR already updated.
Nothing to say about the paintAnchors try/catch in 1c49ebb — it reads correct, and resetting anchoringReady before rethrowing is the right half of that pair.
|
Checked all three against The register one is the one I looked at hardest, since moving
On the diff, No further findings from me on this pass. |
This makes Leaf’s keyboard register enforce one semantic meaning per key and one exact return frame per temporary entry.
cnow always comments in context,g Talone navigates to Threads, andEnterremains native activation or a focused control’s local continuation.The dispatcher now owns a declarative return stack. Entry rows supply liveness, close behavior, and return wording; the dispatcher captures the exact control or reading position before entry, restores displaced panel or tray state, and unwinds nested entries one Escape at a time. Direct destinations, version selection, comment and reply boxes, thread and diff filters, option addition, and commands invoked through Help use that path. The guidance now requires complete-register surveys and escalation of unresolved inconsistencies.
The browser regression suite covers exact restoration across regenerated semantic rows, nested
g T→cflows, query clearing, Help invocation, and theEnter/cdistinction. The shipped PR walkthrough documents and exercises the resulting grammar. Integration with the current base also repairs its live-page fixture directory and ensures the presentation stamp is not published before anchor validation succeeds.Tested with
pre-commit run --all-filesanduv run pytest tests(811 passed).